package com.lnsf.bookstore.system.searchHistory.service.impl;

import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.searchHistory.service.SearchHistoryService;
import com.lnsf.bookstore.system.searchHistory.dao.SearchHistoryMapper;
import com.lnsf.bookstore.system.searchHistory.vo.SearchHistory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class SearchHistoryServiceImpl implements SearchHistoryService {

    @Autowired
    private SearchHistoryMapper searchHistoryMapper;


    @Override
    public int save(SearchHistory searchHistory) {
        return searchHistoryMapper.insertSelective(searchHistory);
    }

    @Override
    public SearchHistory queryObject(Integer id) {
        return searchHistoryMapper.queryObject(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return searchHistoryMapper.deleteBatch(ids);
    }

    @Override
    public int update(SearchHistory searchHistory) {
        return searchHistoryMapper.updateByPrimaryKeySelective(searchHistory);
    }

    @Override
    public PageInfo<SearchHistory> queryList(Map<String, Object> params) {
        return new PageInfo<SearchHistory>(searchHistoryMapper.queryList(params));
    }
}
